import datetime  # 用于datetime对象操作
import os.path  # 用于管理路径
import sys  # 用于在argvTo[0]中找到脚本名称
import backtrader as bt  # 引入backtrader框架
import pandas as pd


stk_code_num =[]
stk_code_file =os.listdir('../data/tdx/day/')            #  数据相对于脚本文件的地址
for stk_code in stk_code_file:
    index1 = stk_code.rfind(".")
    newname_code = stk_code[:index1]
    stk_code_num.append(newname_code)
    # stk_path = '../data/tdx/day/'+stk_code
    # stk_data = pd.read_csv(stk_path, encoding='gbk')
    # print(stk_code_num)
    # stk_code_all =stk_code_all.append(stk_code_all,ignore_index=True)

print(stk_code_num)
stk_code_num = pd.DataFrame(stk_code_num)
dd =stk_code_num.iloc[3,0]
print(dd)